using UnityEngine;
using System.Collections;

public class box : MonoBehaviour {
	

	public GameObject pum;
	
	void Start()
	{
		//rigidbody.useGravity=false;
	}

	
	
	void OnCollisionEnter2D(Collision2D c)
	{
		int f=(int)(c.relativeVelocity.magnitude/5f);
		if(f>=1)
		{
			//rigidbody.useGravity=true;
			
			for(int i=0;i<=f;i++)
			{
				GameObject clone;
				clone=Instantiate(pum,transform.position,transform.rotation) as GameObject;
				Destroy(clone,3f);
			}
		}
	}
}
